// import { get } from "core-js/core/dict";
import { axioed } from "./http";

// tree 获取树状数据
export const tree = (params) =>
  axioed(
    "platform/management/tool_management/treeStructure",
    params,
    "get",
    "json"
  );
// 开启视频推流  platform/nvr_tcp/instruction/start_video
export const startVideo = (pr) =>
  axioed("platform/nvr_tcp/instruction/startVideo", pr, "get");

// 录制视频
export const Recordv = (pr) =>
  axioed("platform/nvr_tcp/instruction/taking_videos", pr, "get", "json");
// 抓拍图片
export const Picture = (params) =>
  axioed("platform/nvr_tcp/instruction/taking_pictures", params, "get");
// 视频断流
export const StopVideo = (params) =>
  axioed("platform/nvr_tcp/instruction/stopVideo", params, "get");
// 设备位置信息
export const NvrMap = (params) =>
  axioed("platform/management/tool_management/selectAllNvr", params, "get"); //
//设备状态信息
export const NvrMonit = (params) =>
  axioed(
    "platform/management/tool_management/selectNvrWorkState",
    params,
    "get"
  );
// 查询图片
export const QuerImg = (params) =>
  axioed("platform/management/tool_management/image", params, "get");
// 查询视频
export const QuerVideo = (params) =>
  axioed(
    "platform/management/tool_management/selectRecordVideo",
    params,
    "get"
  );
// 查询设备
export const QueryDevice = (params) =>
  axioed(
    "platform/management/nvr_management/selectNvrStatistics",
    params,
    "get"
  );
// 保存修改信息
export const SaveSetting = (params) =>
  axioed(
    "platform/management/nvr_management/updateNvr",
    params,
    "post",
    "form"
  );
// 查询所有部门
export const SearchDeprtm = (params) =>
  axioed(
    "platform/management/userBranchManagement/selectBranchStatistics",
    params,
    "get"
  );
// 查询用户信息
export const SearchUser = (params) =>
  axioed(
    "platform/management/userBranchManagement/selectUserStatistics",
    params,
    "get"
  );
// 添加用户
export const AddUser = (params) => {
  axioed(
    "platform/management/userBranchManagement/insertUser",
    params,
    "post",
    "form"
  );
};
// 验证用户名是否存在
export const verfUserName = (params) =>
  axioed(
    "platform/management/userBranchManagement/verificationUsername",
    params,
    "get"
  );
// 删除用户
export const deleteUser = (parmas) =>
  axioed("platform/management/userBranchManagement/deleteUser", parmas, "get");
// 修改用户信息
export const updateUser = (params) =>
  axioed(
    "platform/management/userBranchManagement/updateUser",
    params,
    "post",
    "form"
  );
// 修改用户密码
export const passReset = (params) =>
  axioed(
    "platform/management/userBranchManagement/updateUserPassword",
    params,
    "post",
    "form"
  );
// 添加部门
export const addBranch = (params) =>
  axioed(
    "platform/management/userBranchManagement/addBranch",
    params,
    "post",
    "form"
  );
// 编辑/更新 部门信息
export const updateBranch = (params) =>
  axioed(
    "platform/management/userBranchManagement/updateBranch",
    params,
    "post",
    "form"
  );
// 删除-部门
export const deleteBranch = (params) =>
  axioed(
    "platform/management/userBranchManagement/deleteBranch",
    params,
    "get"
  );

// 查询设备拍照时间表
export const queryPhotoTimes = (params) =>
  axioed(
    "platform/management/nvrConfiguration/selectPhotoInterval",
    params,
    "post",
    "form"
  );
// 查询设备图像采集参数
export const queryPhotoParams = (params) =>
  axioed(
    "platform/management/nvrConfiguration/selectImageParameter",
    params,
    "post",
    "form"
  );

// 查询日志
export const queryLog = (parmas) =>
  axioed(
    "platform/management/LogManagement/selectLogByCondition",
    parmas,
    "post",
    "form"
  );

/**
 * Copyright (c) 2021-12-29
 * 组织管理模块
 */
// 查询树
export const queryTree = (parmas) =>
  axioed("platform/management/cascadeManagement/selectNode", parmas, "get");
// 添加节点
export const addTreeNode = (parmas) =>
  axioed("platform/management/cascadeManagement/addNode", parmas, "get");
//删除节点
export const deleteNode = (parmas) =>
  axioed(
    "platform/management/cascadeManagement/deleteNode",
    parmas,
    "post",
    "form"
  );
// 删除/修改节点设备
export const updateNodeNvr = (parmas) =>
  axioed(
    "platform/management/cascadeManagement/updateNvrByNode",
    parmas,
    "post"
  );
// 查询未绑定设备
export const noBindTree = (parmas) =>
  axioed(
    "platform/management/cascadeManagement/selectNvrByNode",
    parmas,
    "get"
  );
// 修改设备名称
export const updateNodeTitle = (parmas) =>
  axioed(
    "platform/management/cascadeManagement/updateNodeTitle",
    parmas,
    "post",
    "form"
  );
/**
 * Copyright (c) 2021-12-29
 * 设备控制模块
 */

// 修改设备图像参数
export const changeImgParame = (params) =>
  axioed(
    "platform/management/nvrConfiguration/imageParameter",
    params,
    "post",
    "form"
  );
// 修改设备时间参数
export const configTimeParame = (params) =>
  axioed(
    "platform/management/nvrConfiguration/photoInterval",
    params,
    "post",
    "json"
  );
// 升级
export const NvrUpdate = (params) =>
  axioed("platform/nvr_tcp/instruction/remoteUpdate", params, "get");

// 查询主副开启时间
export const selectCamerTimes = (parmas) =>
  axioed(
    "platform/management/nvrConfiguration/selectCameraSwitch",
    parmas,
    "post",
    "form"
  );
// 设置主副开启时间
export const camerSwitch = (parmas) =>
  axioed(
    "platform/management/nvrConfiguration/cameraSwitch",
    parmas,
    "post",
    "json"
  );

//    nvr_id  url

export const Login = (params) => axioed("login", params, "post", "form");
// export const Logins = (par) => post("form/login", par);
// export const sdd = (pp) =>
//   posted("form/login", pp, {
//     "Content-Type": "application/json",
//   });
